class Date {
    public int year;
    public int month;
    public int day;

    //含有三个参数的构造方法
    public Date(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println("调用了一次还有三个参数的构造方法");
    }
    //不含参数的构造方法
    public Date(){
        this.year = 1900;
        this.month = 1;
        this.day = 1;
    }
    //三个参数的构造方法和不含参数的构造方法之间形成了重载
    public void printDate() {
        System.out.println(this.year + "/" + this.month + "/" + this.day);
    }
}

public class test {
    public static void main(String[] args) {
        Date data = new Date(1998, 9, 18);
        data.printDate();
    }
}
